<%@ page contentType="text/html; charset=UTF-8"%>
<%@page import="com.hsd.core.cache.DictCache"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<%@ include file="/app/include.jsp"%>
		<script type="text/javascript">
        	window.UEDITOR_HOME_URL = ctx + "/common/ueditor/";
        </script>
		<style>
			.inner-table{text-align: center;border:1px solid #d4d4d4; border-collapse:collapse;}
			.inner-table thead th{font-weight: normal;}
			.inner-table tbody tr{cursor: pointer;}
			.inner-table th{border-right:1px solid #c1c9b5;height:25px;line-height:25px; color:#333; white-space:nowrap; background:#e9f5d7;}
			.inner-table td{padding:3px 2px; color:#333;border-right:1px solid #dcdedb;background:#fff;}
			.inner-table tr.even td{background:#f0f0f0;}
			.inner-table tr:hover td{background:#fff8d7;}
			.inner-table tr.active td{background:#feeba2;}
			.overflow_warp {position: relative;zoom: 1}
			.select-menubutton {background-color: #fff;border: none;-webkit-border-radius: 3px;-moz-border-radius: 3px;border-radius: 3px;box-shadow: 0 1px 7px rgba(0, 0, 0, 0.5);padding: 3px 0 2px;position: absolute;zoom: 1;text-align: left;z-index: 2000}
			.msg{width: 100%;text-align: center;height: 100px;border:1px solid #dcdedb;padding-top: 30px;}
			.li-inline{min-height: 32px;}
		</style>
		<script src="<%=basePath%>biz/data/insert-one-hp.js"></script>
		<script src="<%=basePath%>common/ueditor/ueditor.files.js"></script>
		<script src="<%=basePath%>common/single/jquery.json-2.2.min.js"></script>
		<script type="text/javascript">
			$(document).ready(function(){
				// 功效搜索
				$("#btnEffectSearch").bind("click",function(evt){
					dropEffectList();
					evt.stopPropagation();
				});
				
				// 病症搜索
				$("#btnDssSearch").bind("click",function(evt){
					dropDssList();
					evt.stopPropagation();
				});
				
				$("#effectSearch").keydown(function(evt){
			        if(event.keyCode == 13){
			            dropEffectList();
						evt.stopPropagation();
			        }
			    });
			    
			    $("#dssSearch").keydown(function(evt){
			        if(event.keyCode == 13){
			            dropDssList();
						evt.stopPropagation();
			        }
			    });
				
				// 页面消除下拉
				$(document).click(function(){
					$("#effect").remove();
					$("#dss").remove();
				});
			});
			
			function returnList(){
			   document.location.replace(ctx+'/datamanage/loadHpList.do');
			}
			// 添加调养方案信息
			function add(){ 
				window.location.href = "${pageContext.request.contextPath}/datamanage/addHpInfo.do";
			}
			
		</script>
	</head>
	<body style="overflow-x:hidden;overflow-y:auto">
		<!--右侧内容-->
		<div class="right_content">
			<div class="breadcrumb">
				<ul>
					<li>
						健康监测
						<span>/</span>
					</li>
					<li>
						调养方案管理
						<span>/</span>
					</li>
					<li class="active">
						新增调养方案
					</li>
				</ul>
			</div>
			<div class="list-wrap" style="position: relative;">
				<h4>
					基本信息
				</h4>
				<form id="modelForm" name="modelForm">
					<input id="id" name="id" type="hidden" value="${hpinfo.id}"/>
					<table width="98%" border="0" cellpadding="0" cellspacing="0"
						class="new">
						<tr>
							<th width="10%">
								<span class="red">*</span> 名称
							</th>
							<td width="35%">
								<input type="text" name="hpname" id="hpname" style="width: 80%" value="${hpinfo.hpName}" />
							</td>
							<th width="10%">
								<span class="red">*</span> 类别
							</th>
							<td>
							    <open:select valueset="[调养方案类别]" id="hptype" name="hptype" width="80%" selectedValue="${hpinfo.type}"/> 
							</td>
						</tr>
						
						<tr>
							<th>
								<span class="red">*</span>方案内容
							</th>
							<td colspan="3">
								<textarea name="hpcontent" id="hpcontent" style="width: 98%" >${hpinfo.hpcontent}</textarea>
							</td>
						</tr>
						<tr>
							<th>
								来源
							</th>
							<td colspan="3">
								<input type="text" name="position" id="position"
									style="width: 80%" value="${hpinfo.position}" />
							</td>
						</tr>
						<tr>
							<th>
								注意事项
							</th>
							<td colspan="3">
								<textarea name="alertinfo" id="alertinfo"  style="width: 98%">${hpinfo.alertinfo}</textarea>
							</td>
						</tr>
						<tr>
							<td colspan="4" align=center>
								<input type="button" class="btn btn-primary"
									onclick="saveHpinfo();" value="保存" />
								<input type="button" class="btn"
									onclick="returnList();" value="返回列表" />
							</td>
						</tr>
					</table>
				</form>
				<script type="text/javascript">
					var ue = UE.getEditor('hpcontent', {  
			            initialContent : '',//初始化编辑器的内容  
			            initialFrameHeight:200, 
			            minFrameHeight : 100,//设置高度  
			            textarea : 'hpcontent',//设置提交时编辑器内容的名字，之前我们用的名字是默认的editorValue  
			            elementPathEnabled:false,
			            autoHeightEnabled:false,
			            autoFloatEnabled:false,
			            wordCount:false,
			            pasteplain:true, 
			            fullscreen:false,
			            imagePopup:true,
			            allHtmlEnabled:false,
			            toolbars:[['bold','italic','underline','|','forecolor','|','insertunorderedlist','insertorderedlist','fontsize','imagenone','imageleft','imagecenter','imageright','fontfamily','justifyleft','justifycenter','justifyright','insertimage','background','wordimage','horizontal']]
			        });
					ue.ready(function(){
						if (UE.browser.ie && UE.browser.version <= 7){
							FixIe7Bug();
						 }
					})
					var ue1 = UE.getEditor('alertinfo', {  
			            initialContent : '',//初始化编辑器的内容  
			            minFrameHeight : 80,//设置高度  
			            initialFrameHeight:100,  
			            textarea : 'alertinfo',//设置提交时编辑器内容的名字，之前我们用的名字是默认的editorValue  
			            elementPathEnabled:false,
			            autoHeightEnabled:false,
			            autoFloatEnabled:false,
			            wordCount:false,
			            pasteplain:true, 
			            toolbars:[['bold','italic','underline','|','forecolor','|','insertunorderedlist','insertorderedlist']]
			        });
					ue1.ready(function(){
						 if (UE.browser.ie && UE.browser.version <= 7){
							FixIe7Bug();
						 }
					})
				</script>
		 		<div id="hp-otherinfo" style="display:none"> 
				<h4>
					方案功效
				</h4>
				<div style="margin-left: 5%;">
					<ul id="effectlist" class="li-inline">
					</ul>
					<h5>
						编辑方案功效
					</h5>
					<input id="effectSearch" type="text" style="width: 245px;" />
					<input id="btnEffectSearch" type="button" class="btn" value="搜索"/>
					<div id="effectT"></div>
					<br />
					<br />
				</div>
				<h4>
					治疗病症
				</h4>
				<div style="margin-left: 5%">
					适应症：
					<ul id="dsslist1" class="li-inline">
					</ul>
					禁忌症：
					<ul id="dsslist2" class="li-inline">
					</ul>		
					<h5>
						编辑治疗病症
					</h5>
					<input id="dssSearch" type="text" style="width: 245px;" />
					<input id="btnDssSearch" type="button" class="btn" value="搜索" />
					<div id="dssT"></div>
					<br />
					<br />
				</div>
				<div style="margin: 50px 30% 20px">
					<input type="button" class="btn btn-primary" value="创建新方案" onclick="add();"/>
				</div>
			</div>
		</div>
		</div>
	</body>
</html>